package day13线程和并发;


class MusicRunableImpl implements java.lang.Runnable{ 
	
	public void run() {
		for (int i = 0; i < 50; i++) {
			System.out.println("播放音乐"+i);
		     }
	}
}
public class ImplementsRunnableDemo {
   public static void main(String[] args) {
	   for (int i = 0; i < 50; i++) {
	    	 System.out.println("打游戏"+i);
	    	 if(i==10){
	    		 /* Thread(Runnable target) 
	                                 分配新的 Thread 对象。*/
	    		 Runnable target= new MusicRunableImpl();
	    		 Thread t= new Thread(target);
	    		 t.start();
	    	 }
		  }
    }
}
